{itemplate 'public/header'}
{if $op == 'set'}
<div class="page clearfix">
	<h2>{$_W['page']['title']}</h2>
	<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data">
		<div class="alert alert-warning">短信使用"阿里大于"短信平台"。<a href="http://www.alidayu.com/" target="_blank">立即申请</a></div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">开启短信功能</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" value="1" name="status" id="status-1" {if $sms['status'] == 1}checked{/if} required="true">
					<label for="status-1">开启</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" value="0" name="status" id="status-0" {if !$sms['status']}checked{/if} required="true">
					<label for="status-0">关闭</label>
				</div>
				<div class="help-block">开启短信功能后,所有线路都可以使用该短信设置.</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">接口类型</label>
			<div class="col-sm-9 col-xs-12">
				<div class="radio radio-inline">
					<input type="radio" value="1" name="version" id="version-1" {if $sms['version'] == 1 || empty($sms['version'])}checked{/if}>
					<label for="version-1">旧版</label>
				</div>
				<div class="radio radio-inline">
					<input type="radio" value="2" name="version" id="version-2" {if $sms['version'] == 2}checked{/if}>
					<label for="version-2">新版(2017年6月之后申请的)</label>
				</div>
				<span class="help-block">由于阿里大于接口调整，需要根据申请时间来区分支付接口</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">AppKey</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" class="form-control" name="key" value="{$sms['key']}">
				<span class="help-block">还没有短信账号? <a href="http://www.alidayu.com/service?spm=a3142.7816148.1.2.4hG4Zd#about" target="_blank">现在去创建</a>。 如果是新版接口，此处填写：Access Key ID</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">AppSecret</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" class="form-control" name="secret" value="{$sms['secret']}">
				<span class="help-block">如果是新版接口，此处填写：Access Key Secret</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">短信签名</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" class="form-control" name="sign" value="{$sms['sign']}">
				<span class="help-block">请填写短信签名.</span>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="hidden" name="token" value="{$_W['token']}">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>
		</div>
	</form>
</div>
{/if}

{if $op == 'template'}
<div class="page clearfix">
	<h2>{$_W['page']['title']}</h2>
	<form class="form-horizontal form form-validate" id="form1" action="" method="post" enctype="multipart/form-data">
		<div class="form-group">
			<label class="col-xs-12 col-sm-3 col-md-2 control-label">身份验证验证码 模板id</label>
			<div class="col-sm-9 col-xs-12">
				<input type="text" class="form-control" name="verify_code_tpl" value="{$sms['verify_code_tpl']}" required="true">
				<span class="help-block">请登录"阿里大鱼"短信平台,进入管理中心,进行验证码模板申请</span>
				<span class="help-block">
					<strong class="text-danger">
						模板名称: 通用验证码<br>
						模板详情: 验证码${code},打死也不能告诉别人哦
					</strong>
				</span>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-9 col-xs-9 col-md-9">
				<input type="hidden" name="token" value="{$_W['token']}">
				<input type="submit" value="提交" class="btn btn-primary">
			</div>
		</div>
	</form>
</div>
{/if}
{itemplate 'public/footer'}
